package autowired.controller;

import autowired.bean.User;
import autowired.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

/**
 * @author azzhu
 * @create 2020-08-14 16:05:15
 */
@Controller
public class UserController {

    @Autowired
    public UserService userService;

    public void addUser(User user) {
        //前端页面的表单，你只要属性跟user的一致，就能够自动封装成一个user对象
        //Springmvc 就可以搞定
        System.out.println("controller ......");
        userService.addUser(user);
    }

}
